package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.StoreDao;
import com.vne.skyemart.model.Store;
import com.vne.skyemart.service.StoreService;

@Service("storeService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class StoreServiceImpl implements StoreService{
	@Autowired
	private StoreDao storeDao;

	public StoreDao getStoreDao() {
		return storeDao;
	}

	public void setStoreDao(StoreDao storeDao) {
		this.storeDao = storeDao;
	}
	public StoreServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addStore(Store store) {
		storeDao.save(store);
	}

	@Override
	public List<Store> listStore() {
		return storeDao.findAll();
	}
	
}
